﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RandomNumberInRange
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void butonSubmit_Click(object sender, EventArgs e)
        {
            int rangeMin = int.Parse(this.firstNumber.Value);
            int rangeMax = int.Parse(this.secondNumber.Value);
            Random rand = new Random();
            this.spanche.InnerText = rand.Next(rangeMin, rangeMax).ToString();
        }

        protected void aspButton_Click(object sender, EventArgs e)
        {
            int rangeMin = int.Parse(this.aspTextBox1.Text);
            int rangeMax = int.Parse(this.aspTextBox2.Text);
            Random rand = new Random();
            this.label.Text = rand.Next(rangeMin, rangeMax).ToString();
        }           
    }
}